<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">

    <!-- switchery -->
    <link rel="stylesheet" href="${_css}/switchery/switchery.min.css" />

    <script src="${_js}/jquery.min.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

</head>

<body style="background: #F7F7F7;">
<div class="">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>编辑银行卡信息</h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form class="form-horizontal form-label-left" novalidate>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">名称 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                        		<input type="hidden" id="bankCardId" value="<#if item?exists & item.id?exists>${item.id}</#if>"></hidden>
                            	<input id="bankCode" class="form-control col-md-7 col-xs-12" value="<#if item?exists & item.bankCode?exists>${item.bankCode}</#if>"
                            	name="bankCode" placeholder="输入银行编号名称" required="required" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">支行名称 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<input id="subbranch" class="form-control col-md-7 col-xs-12" value="<#if item?exists & item.subbranch?exists>${item.subbranch}</#if>"
                            	name="subbranch" placeholder="输入支行名称" required="required" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">开户省份<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<input id="provice" class="form-control col-md-7 col-xs-12"  readonly="readonly" 
                            	value="<#if item?exists & item.provice?exists>${item.provice}</#if>"
                            	name="provice" placeholder="输入开户省份" required="required" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">开户城市<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<input id="city" class="form-control col-md-7 col-xs-12"  readonly="readonly" 
                            	value="<#if item?exists & item.city?exists>${item.city}</#if>"
                            	name="city" placeholder="输入开户城市" required="required" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">银行卡号<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<input id="cardNo" class="form-control col-md-7 col-xs-12"  readonly="readonly" 
                            	value="<#if item?exists & item.cardNo?exists>${item.cardNo}</#if>"
                            	name="cardNo" placeholder="输入银行卡号" required="required" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">开户人姓名<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<input id="cardAuthName" class="form-control col-md-7 col-xs-12"  readonly="readonly" 
                            	value="<#if item?exists & item.cardAuthName?exists>${item.cardAuthName}</#if>"
                            	name="cardAuthName" placeholder="输入开户人姓名" required="required" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">开户人预留手机号<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<input id="cardAuthPhone" class="form-control col-md-7 col-xs-12" readonly="readonly"
                            	value="<#if item?exists & item.cardAuthPhone?exists>${item.cardAuthPhone}</#if>"
                            	name="cardAuthPhone" placeholder="输入开户人预留手机号" required="required" type="text">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
	</div>
    <div class="row">
		<div class="col-md-12 col-sm-12 col-xs-12">
		    <div class="ln_solid"></div>
		    <div class="form-group">
		        <div class="col-md-12 col-md-offset-5">
		            <button type="button" onclick="javascript:history.go(-1)" class="btn btn-primary">返回前一页</button>
		            <button id="send" type="button" class="btn btn-success">保存</button>
		        </div>
		    </div>			
		</div>
	</div> 
</div>
    <script src="${_js}/bootstrap.min.js"></script>
    <!-- bootstrap progress js -->
	<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
	<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
    <!-- icheck -->
    <script src="${_js}/icheck/icheck.min.js"></script>
    
	<script src="${_js}/custom.js" type="text/javascript"></script>
            
	 <!-- PNotify -->
	<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
	<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
	<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>   
	
    <script type="text/javascript">
		$(".btn-success").click(function(){
			var bankCardId = $("#bankCardId").val();
			var bankCode = $.trim($("#bankCode").val());
			var subbranch = $.trim($("#subbranch").val());
			var provice = $.trim($("#provice").val());
			var city = $.trim($("#city").val());
			var cardNo = $.trim($("#cardNo").val());
			var cardAuthName = $.trim($("#cardAuthName").val());
			var cardAuthPhone = $.trim($("#cardAuthPhone").val());
			
			var info=JSON.stringify({
				id:bankCardId,
				bankCode:bankCode,
				subbranch:subbranch,
				provice:provice,
				city:city,
				cardNo:cardNo,
				cardAuthName:cardAuthName,
				cardAuthPhone:cardAuthPhone
			});
			$.ajax({
	            type: 'POST',
	            dataType: 'JSON',
	            async:'false',
	            headers: {'Content-type': 'application/json;charset=UTF-8'},
	            url: '/admin/bankCard/save',
	            data:info,
	            success: function(result){
	       		  if(result.code==-1){
	            		new PNotify({
			            	title: '操作提示',
			            	text: '保存成功',
			            	delay: 3e3,
			            	type: 'success'
			        	});
			        	window.location.href="/admin/bankCard/list";	   
	       		  }else{
	            		new PNotify({
			            	title: '操作提示',
			            	text: result.msg,
			            	delay: 3e3,
			            	type: 'error'
			        	});       		  	
	       		  }
	            }
		    })	
			
		});
    </script>
</body>

</html>